package light.mvc.model.wxn;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import light.mvc.model.base.IdEntity;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table(name = "WXN_WEI_TAGS")
@DynamicInsert(true)
@DynamicUpdate(true)
public class WeiTagsBO extends IdEntity implements java.io.Serializable {
	
	@Column(name = "TAG_APPID")
	private Integer tagAppid; // appid

	@Column(name = "TAG_ID")
	private Integer tagId; // 标签ID

	@Column(name = "TAG_NAME", length = 36, nullable = false)
	private String tagName; // 标签名字

	@Column(name = "TAG_COUNT")
	private Integer tagCount; // 用户数量

	@Column(name = "TAG_NOTE", length = 36, nullable = false)
	private String tagNote; // 备注
	
	private WeiTagsBO weiTagsBO;
	
	private Set<WeiTagsBO> WeiTagsBOs = new HashSet<WeiTagsBO>(0);
	
	public WeiTagsBO(){
		super();
	}
	
	public WeiTagsBO(Integer tagId,String tagName,Integer tagCount,String tagNote){
		this.tagId=tagId;
		this.tagCount=tagCount;
		this.tagName=tagName;
		this.tagNote=tagNote;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pid")// 父菜单ID
	public WeiTagsBO getWeiTagsBO() {
		return weiTagsBO;
	}
	public void setWeiTagsBO(WeiTagsBO weiTagsBO) {
		this.weiTagsBO = weiTagsBO;
	}
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "weiTagsBO")
	public Set<WeiTagsBO> getWeiTagsBOs() {
		return WeiTagsBOs;
	}

	public void setWeiTagsBOs(Set<WeiTagsBO> weiTagsBOs) {
		WeiTagsBOs = weiTagsBOs;
	}
	
	public Integer getTagId() {
		return tagId;
	}
	


	public void setTagId(Integer tagId) {
		this.tagId = tagId;
	}

	public String getTagName() {
		return tagName;
	}

	public void setTagName(String tagName) {
		this.tagName = tagName;
	}

	public Integer getTagCount() {
		return tagCount;
	}

	public void setTagCount(Integer tagCount) {
		this.tagCount = tagCount;
	}

	public String getTagNote() {
		return tagNote;
	}

	public void setTagNote(String tagNote) {
		this.tagNote = tagNote;
	}

	public Integer getTagAppid() {
		return tagAppid;
	}

	public void setTagAppid(Integer tagAppid) {
		this.tagAppid = tagAppid;
	}
	
	
}
